import md5 from "js-md5";
import { requestJSON } from "./url"

export async function signLogin(data) {
    return requestJSON({
        url: "/SignLogin",
        method: "post",
        data,
    });
}

export async function toCookiesSave() {
    let timestamp = parseInt(new Date().getTime() / 1000);
    let params = timestamp + "_nijunwen_" + "e4daded24a4a2b0e57d70ab52790deba";
    let signature = md5(params);
    const data = {
        signature,
        timestamp,
        username: "nijunwen",
    };
    return signLogin(data);
};
